<?php
require("../class/connect.php");
include("../class/db_sql.php");
include("../class/config.php");
include("../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"do");
$enews=$_GET['enews'];
$url="<a href=ListDo.php>管理刷新任务</a>&nbsp;->&nbsp;增加定时刷新任务";
$r[dotime]=30;
$doing0=" selected";
$doing1="";
$isopen=" checked";
//修改
if($enews=="EditDo")
{
	$doid=(int)$_GET['doid'];
	$r=$empire->fetch1("select * from {$dbtbpre}enewsdo where doid='$doid'");
	$url="<a href=ListDo.php>管理刷新任务</a>&nbsp;->&nbsp;修改定时刷新任务";
	if($r[doing])
	{
		$doing0="";
		$doing1=" selected";
	}
	if($r[isopen])
	{
		$isopen=" checked";
	}
	else
	{$isopen="";}
}
//类别
$class=ShowClass_AddClass("",$r[classid],0,"|-",0,0);
db_close();
$empire=null;
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>定时刷新任务</title>
<link href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="98%%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <td height="25">位置：<?=$url?></td>
  </tr>
</table>

<form name="form1" method="post" action="ListDo.php">
  <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
    <tr class="header"> 
      <td height="25" colspan="2">增加定时刷新任务 
        <input name="enews" type="hidden" id="enews" value="<?=$enews?>"> <input name="add[doid]" type="hidden" id="add[doid]" value="<?=$doid?>"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="22%" height="25">任务名：</td>
      <td width="78%" height="25"><input name="add[doname]" type="text" id="add[doname]" value="<?=$r[doname]?>">
        (比如首页定时刷新)</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="25">开启：</td>
      <td height="25"><input name="add[isopen]" type="checkbox" id="add[isopen]" value="1"<?=$isopen?>>
        是 </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">任务类型：</td>
      <td height="25"> <select name="add[doing]" size="3" id="add[doing]">
          <option value="0"<?=$doing0?>>刷新首页</option>
          <option value="1"<?=$doing1?>>刷新栏目页面</option>
        </select>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">执行时间间隔：</td>
      <td height="25"><input name="add[dotime]" type="text" id="add[dotime]" value="<?=$r[dotime]?>" size="6">
        分钟(小于12分钟系统将视为12分钟)</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">操作对象：<br>
        (首页刷新此栏失效) </td>
      <td height="25"><select name="add[classid]" size="16" id="add[classid]" style="width:210">
	  <?=$class?>
        </select></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">&nbsp;</td>
      <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
    </tr>
  </table>
</form>
</body>
</html>
